Skip to content

Covered runs continue in CoderHelm's own pull request; a person's is never touched - #489

Merged
nambok merged 2 commits into
mainfrom
fix/covered-run-continues-own-pr
Nov 6, 2026
Merged

nambok merged 2 commits into
mainfrom
fix/covered-run-continues-own-pr

Conversation

@nambok

@nambok nambok commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A run whose ticket an open pull request already covers no longer stops with only Open and Retry when that pull request is CoderHelm's own. It continues in it: what the run built goes onto that pull request's branch, its description gets a section for this ticket with what was carried over and what is still open, and the run ends linked to it. One pull request for the work, not two.

Only pull requests CoderHelm created are ever pushed to, edited or closed. A person's pull request is never touched: the run ends linked to it and says plainly that the person's pull request covers the ticket. This is enforced in code, not by convention.

The ticket's earlier CoderHelm pull request that the covering one makes redundant is marked superseded in its own description and on the run page, which offers "Close #N". It closes only on a person's click: no existing team setting lets CoderHelm close its own superseded pull requests (the only automatic close today is the separate "moved to another repository" case, which this does not change).

Changes

  • common::own_pr (new): judge decides whether CoderHelm may change a pull request, from GitHub's answer at that moment. It must be open, opened by this app's bot (the exact login when known), on a branch in the repository and not a fork, and recorded by one of the team's runs. The worker and the gateway both use it.
  • common::stop_rules::covering (new): the outcomes (continued, complete, person, busy, not_carried), the run record stored as covered_by, the description section (replaced in place on a later run), the superseded line, and the run page and ticket notes.
  • existing_work: the model's verdict now also lists what the pull request doesn't do yet for the ticket (missing). These are the open items the covered check names.
  • worker/passes/covering.rs (new):
    • OwnPr can only be made by OwnPr::verify (a fresh read plus judge), and each write checks again right before it happens. The covering branch only moves forward from the head it was read at, never with a force push. Pushes and description edits go only through it. Nothing in the covered path closes a pull request.
    • When the run's branch is built on the covering branch (the reported case), the push is a fast forward. When the two diverged, the run's own change is rebuilt on it with restack first. A file both changed that can't be merged stops the carry-over, and nothing is pushed.
    • Before writing, the covered path counts as a pass (run_guard::on_pass), so the loop guard and the run ceiling from Runs always end: PR before the checks, rounds that survive continuations, and a ceiling on every run #485 stop it first. It also claims the covering pull request's runs' writer slots (pr_holder), so two runs never write one branch. If that run is busy, nothing is written.
    • When the covering pull request merged or closed meanwhile, the run takes its normal path.
  • Pipeline (passes/mod.rs):
    • At the check before the pull request opens, the covered path replaces the old stop. It gets the run's unfinished required tasks and the ticket's earlier pull request.
    • At the check before any work, if CoderHelm's own covering pull request lacks something, the run stacks on its branch, builds what is missing, and remembers that pull request on its checks ledger. When it reaches the pull request step it carries the work over without asking the model again. If the covering pull request already has everything, or it is a person's, the run ends as before with the new wording.
  • GitHubClient: fast_forward (lease plus force: false) and a public bot_login.
  • Gateway: RunCoveredBy gains own, outcome, carried, open_items, superseded and note (OpenAPI regenerated). New POST /api/runs/:run_id/close-superseded (member+, in the runs capability). It closes the superseded pull request only when the covering one is CoderHelm's own and carries the change. It judges the pull request on GitHub first, comments, closes, then marks the record.
  • selfhost/versions.json: dashboard pinned to 506746110e88ee244de302a8bd83888ac2420535 (the run page change, merged as Run page: a covered run shows what it carried and offers to close the superseded pull request coderhelm#326) with scripts/bump-dashboard.sh.

Verification

  • cargo fmt --all --check, cargo clippy -p worker -p common -p gateway --all-targets -D warnings, cargo test for worker, common and gateway.
  • New tests:
    • Own covering pull request continued with the missing items: fast forward, description section with open items, earlier pull request marked superseded and not closed.
    • Diverged branch rebuilt, then pushed. Unmergeable file: nothing pushed.
    • Complete covering pull request: no push and no edit of it, earlier one marked for a click-close.
    • Person's pull request (user, a login containing the product name, another bot, or an unrecorded one): no writes at all.
    • Merged or closed meanwhile: normal path.
    • Covering branch moved: not overwritten.
    • OwnPr forged for a person's pull request, a fork, or one no run recorded (as if verify were bypassed): push and edit are refused, with zero writes.
    • Source checks: only OwnPr reaches the raw writes, nothing closes a pull request, and run_guard::on_pass and the writer claim come before take.
    • Gateway: superseded close planned only for the own covering outcomes, and judged on GitHub before closing.
  • Not verified against a live repository: the GitHub calls (fast_forward, compare, rebuild) were exercised through fakes only.

@nambok
nambok force-pushed the fix/covered-run-continues-own-pr branch from 1c295b2 to bb5c6d4 Compare November 6, 2026 14:44
…never touched

A run whose ticket CoderHelm's own open pull request already covers no longer
stops: it carries what that pull request lacks onto its branch, adds the
ticket to its description and ends linked to it. The ticket's earlier pull
request is marked superseded and closes only on a person's click. Only pull
requests CoderHelm created are pushed to, edited or closed (common::own_pr,
OwnPr), checked again at each write.
@nambok
nambok force-pushed the fix/covered-run-continues-own-pr branch from bb5c6d4 to dbae5fc Compare November 6, 2026 14:53
@nambok
nambok merged commit 0d1b01b into main Nov 6, 2026
10 checks passed
@nambok
nambok deleted the fix/covered-run-continues-own-pr branch November 6, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant